package com.ai.controller.made;

import com.ai.common.CommonResponse;
import com.ai.entity.file.Video;
import com.ai.entity.file.VideoPage;
import com.ai.service.made.VideoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 *
 * 录像文件上传
 * @Author：xiaosheng
 * @Date：2024/6/18 16:25
 */
@RestController
@RequestMapping("/video")
public class VideoController {

    @Resource
    VideoService videoService;


    /**
     * 录像信息上传
     *
     * @param file
     * @return
     */
    @PostMapping("/upload")
    @ApiOperation("录像文件上传")
    public CommonResponse insert(@RequestParam("file") MultipartFile[] file, @RequestParam("functionType") Integer functionType) {

        return videoService.upload(file, functionType);
    }


    @PostMapping("/list")
    @ApiOperation("查询未检测录像信息")
    public CommonResponse videoList(@RequestBody VideoPage videoPage){
        return videoService.videoList(videoPage);
    }



    @PostMapping("/delete")
    @ApiOperation("录像文件删除")
    public CommonResponse delete(@RequestBody Video video){
        return videoService.delete(video);
    }






}
